<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  // 将"i love javascript very much"的每个单词的第一个字母，变为大写。

  var str = "i love javascript very much";
  var strList = str.split(" ");
  for(var i = 0; i < strList.length; i++){
    var str = strList[i].split('');
    str[0] = str[0].toUpperCase();
    strList[i] = str.join("");
  } 
  console.log(strList.join(" "));

</script>
</html>